package com.info33.platform.business.app.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.info33.platform.business.app.dto.AppFeedbackDTO;
import com.info33.platform.business.app.entity.AppFeedback;
import com.info33.platform.business.app.service.AppFeedbackService;
import com.info33.platform.common.mvc.controller.BaseController;
import com.info33.platform.common.mvc.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author admin
 */
@RestController
@RequestMapping("/AppFeedback")
@Api(tags = "app - 意见反馈表")
public class AppFeedbackController extends BaseController<AppFeedbackService, AppFeedback> {

    private final AppFeedbackService appFeedbackService;

    @Autowired
    public AppFeedbackController(AppFeedbackService appFeedbackService) {
        super(appFeedbackService);
        this.appFeedbackService = appFeedbackService;
    }

    @PostMapping(value = "/app/my/{pageNum}/{pageSize}")
    @ApiOperation(value = "app 我的反馈")
    public Result<IPage<AppFeedback>> appMyHistory(
            @RequestBody AppFeedbackDTO dto,
            @PathVariable int pageNum,
            @PathVariable int pageSize) {
        return Result.ok(appFeedbackService.appMyHistory(new Page<>(pageNum, pageSize), dto, getCurrentUser()));
    }

}